<?php

class Application_Form_InlineForm extends Application_Form_Form {

    public function __construct($options = null) {
        parent::__construct($options);

        $this->setDecorators(array(
            'FormElements',
            'Form'
        ));
    }

    public function getElementDecorators($id = null) {
        $html_tag = array('tag' => 'div', 'class' => 'block');
        if ($id) {
            $html_tag['id'] = $id;
        }
        return array(
            'ViewHelper',
            array('Label', array('separator' => '')),
            array('HtmlTag', $html_tag)
        );
    }
	
    public function getElementDecoratorsinline($id = null) {
    	$html_tag = array('tag' => 'div', 'class' => 'ligne');
    	if ($id) {
    		$html_tag['id'] = $id;
    	}
    	return array(
    			'ViewHelper',
    			array('Label', array('separator' => '')),
    			array('HtmlTag', $html_tag)
    	);
    }
    
    public function getRatingDecorators($id = null) {
    	$html_tag = array('tag' => 'div', 'class' => 'block rate');
    	if ($id) {
    		$html_tag['id'] = $id;
    	}
    	return array(
    			'ViewHelper',
				array('Label', array('separator' => '')),
    			array('HtmlTag', $html_tag)
    	);
    }
    
    public function getInputFileDecorators($id = null){
    	return array(
    			'File',
    			'Errors',
    			array('Description', array('escape' => false, 'tag' => '', 'placement' => 'append')),
    			array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'e')),
    			array('Label', array('tag' => 'div', 'class' => 'e')),
    			array('HtmlTag', array('tag' => 'div', 'class' => 'block'))
    	);
    }
    
	  public function getElementSansDecorators($id = null) {
        $html_tag = array('tag' => 'div', 'class' => 'block');
        if ($id) {
            $html_tag['id'] = $id;
        }
        return array(
            'ViewHelper',
            array('HtmlTag', $html_tag)
        );
    }
    
    public function getElementDecoratorHidden($id = null) {
    	$html_tag = array('tag' => 'div', 'class' => 'hidden');
    	if ($id) {
    		$html_tag['id'] = $id;
    	}
    	return array(
    			'ViewHelper',
    			array('HtmlTag', $html_tag)
    	);
    }
    
    public function getCheckboxDecorators() {
        return array(
            'ViewHelper',
            array('Label', array('placement' => 'append')),
            array('HtmlTag', array('tag' => 'div', 'class' => 'block')),
        );
    }

    public function getSubmitDecorators() {
        return array(
            'ViewHelper',
            array('HtmlTag', array('tag' => 'div', 'class' => 'block shift'))
        );
    }
    
    public function getSubmitDecoratorsinline() {
    	return array(
    			'ViewHelper',
    			array('HtmlTag', array('tag' => 'div', 'class' => 'ligne'))
    	);
    }

    public function getGroupDecorators($shift_block = false) {
        $html_tag = array('tag' => 'div', 'class' => 'block');
        if ($shift_block) {
            $html_tag['class'] .= ' shift';
        }
        return array(
            'FormElements',
            array('HtmlTag', $html_tag)
        );
    }

}
